import React, { useState } from "react";
import logo from "./logo.svg";
import "./App.css";
import { login } from "./api";

function App() {
  const [username, setUsername] = useState("1212312312313");
  const [password, setPassword] = useState("");
  const handleLogin = () => {
    login({
      username,
      password,
    });
  };
  return (
    <div className="App">
      {username}
      <input
        type="text"
        value={username}
        onChange={(e) => setUsername(e.target.value)}
      />
      <input
        type="text"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
      />
      <button onClick={() => handleLogin()}>登录</button>
    </div>
  );
}

export default App;
